package com.ydzh.kfqgwvisitor.exception;

import com.ydzh.kfqgwvisitor.enums.ResultEnum;
import lombok.Data;

@Data
public class BaseException extends RuntimeException {
    private int code;
    private String msg;

    public BaseException(int code, String msg) {
        super(msg);
        this.code = code;
        ;
        this.msg = msg;
    }


    public BaseException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
        ;
        this.msg = resultEnum.getMessage();

    }
}
